/////////////////////////////////////////////////////////////////////////
//
// Amuse Engine - graphics/materials
// Copyright (c) 2015.  All Rights Reserved
//
// File:		AEMaterialTextures.cpp
// Author:		Gianluca Belardelli
// Date:		20/07/2015
//
/////////////////////////////////////////////////////////////////////////
#include <AEEngine.h>

void AEMaterialTextures::SetTextureFile( AETextureType eType, const char *lpszFileName )
{
	switch( eType )
	{
		case AETEXTURETYPE_DIFFUSE: 
			m_spDiffuseTexture = AEngine::GetTextureManager()->Load2DTextureFromFile( lpszFileName );
			break;
		case AETEXTURETYPE_NORMALMAP: break;
			m_spNormalMap = AEngine::GetTextureManager()->Load2DTextureFromFile( lpszFileName );
			break;
		case AETEXTURETYPE_SPECULARMAP: break;
			m_spSpecularMap = AEngine::GetTextureManager()->Load2DTextureFromFile( lpszFileName );
			break;
	};
}

const char *AEMaterialTextures::GetTextureFile( AETextureType eType ) const
{
	switch( eType )
	{
		case AETEXTURETYPE_DIFFUSE: return GetBaseTexture();
		case AETEXTURETYPE_NORMALMAP: return GetNormalMapTexture();
		case AETEXTURETYPE_SPECULARMAP: return GetSpecularMapTexture();
	};

	return AENULL;
}

void AEMaterialTextures::SetTexture( AETextureType eType, AETexture *lpTex )
{
	switch( eType )
	{
		case AETEXTURETYPE_DIFFUSE: 
			m_spDiffuseTexture = lpTex;
			break;
		case AETEXTURETYPE_NORMALMAP: break;
			m_spNormalMap = lpTex;
			break;
		case AETEXTURETYPE_SPECULARMAP: break;
			m_spSpecularMap = lpTex;
			break;
	};
}

AETexture *AEMaterialTextures::GetTexture( AETextureType eType ) const
{
	switch( eType )
	{
		case AETEXTURETYPE_DIFFUSE: return m_spDiffuseTexture;
		case AETEXTURETYPE_NORMALMAP: return m_spNormalMap;
		case AETEXTURETYPE_SPECULARMAP: return m_spSpecularMap;
	};
}

void AEMaterialTextures::SetBaseTexture( AETexture *lpTex )
{
	m_spDiffuseTexture = lpTex;
}

void AEMaterialTextures::AllocateAuxiliaryTextures( AEINT32 nCount )
{
}

